<template>
  <div>
    <h3>地址页面</h3>

    <ul class="addresslist">
      <li v-for="item in list" :key="item.id">
        <div>{{ item.name }}</div>
        <div class="info">
          <p>{{ item.mobile }}</p>
          <p>{{ item.address }}{{ item.address_detail }}</p>
        </div>

        <div></div>
        <!-- <p>{{ item.name }} &nbsp;&nbsp;&nbsp; {{ item.mobile }}</p> -->
        <!-- <p>{{ item.address }}{{ item.address_detail }}</p> -->
      </li>
    </ul>

    <div class="bottom">+新建地址</div>
  </div>
</template>

 <script>
import { detailAction, getListAction } from "@/api/cart/address/index";
export default {
  data() {
    return {
      list: [],
    };
  },
  computed: {},
  created() {
    this.init();
  },
  mounted() {},
  methods: {
    init() {
      getListAction({
        openId: localStorage.getItem("openId"),
      }).then((res) => {
        console.log(res);
        this.list = res.data.data;
      });
    },
  },
};
</script>
<style scoped lang="scss">
.addresslist {
  li {
    width: 354px;
    height: 64px;
    position: relative;
    padding: 0.4rem 0;
    border-bottom: 1px solid #d9d9d9;
    div:first-child {
      float: left;
      width: 1.33333rem;
      text-align: center;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      align-self: flex-start;
    }

    .info {
      text-align: left;
      padding: 0 0.26667rem;
      overflow: hidden;
      flex: 1;
    }

    div:nth-child(3) {
      // float: right;
      position: absolute;
      right: 8px;
      top: 8px;
      width: 0.66667rem;
      height: 0.66667rem;
      margin: 0 0.26667rem;
      background: url(http://jinglins.gitee.io/legou/img/edit.d508a455.png)
        no-repeat;
      background-size: 100% 100%;
    }
  }
}

.bottom {
  position: fixed;
  // top: 554px;
  left: 5%;
  z-index: 6;
  bottom: 10px;
  width: 90%;
  height: 0.93333rem;
  line-height: 0.93333rem;
  text-align: center;
  border: 1px solid #b4282d;
  color: #b4282d;
  margin: 0 auto;
}
</style>
